wayland: Don't crash with offscreen windows
authorMatthias Clasen <mclasen@redhat.com>
Sat, 5 Mar 2016 01:01:57 +0000 (20:01 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 5 Mar 2016 01:04:43 +0000 (20:04 -0500)
Use gdk_window_get_effective_toplevel when looking for
a suitable transient parent, to skip over offscreen windows
that we might encounter in the window tree. This fixes
a crash in glade.

https://bugzilla.gnome.org/show_bug.cgi?id=763110

gdk/wayland/gdkwindow-wayland.c

index 9439c1abc614dae61a26f35c78f0c6844e79ccc6..750975a3208424832aed51e422afefae514d892f 100644 (file)
@@ -1633,7 +1633,7 @@ gdk_wayland_window_map (GdkWindow *window)
             }
 
           if (transient_for)
-            transient_for = get_popup_parent (gdk_window_get_toplevel (transient_for));
+            transient_for = get_popup_parent (gdk_window_get_effective_toplevel (transient_for));
 
           /* If the position was not explicitly set, start the popup at the
            * position of the device that holds the grab.